Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: make redux and react-redux truly optional #768

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

adamstankiewicz
Copy link
Member

@adamstankiewicz adamstankiewicz commented Feb 21, 2025

Description:

#766

Per this comment, this PR reintroduces the changes to make the redux and react-redux peer dependencies optional.

Merge checklist:

  • Consider running your code modifications in the included example app within frontend-platform. This can be done by running npm start and opening http://localhost:8080.
  • Consider testing your code modifications in another local micro-frontend using local aliases configured via the module.config.js file in frontend-build.
  • Verify your commit title/body conforms to the conventional commits format (e.g., fix, feat) and is appropriate for your code change. Consider whether your code is a breaking change, and modify your commit accordingly.

Post merge:

  • After the build finishes for the merged commit, verify the new release has been pushed to NPM.

Copy link

codecov bot commented Feb 21, 2025

Codecov Report

Attention: Patch coverage is 71.42857% with 6 lines in your changes missing coverage. Please review.

Project coverage is 83.13%. Comparing base (58c411c) to head (1c2d2cf).

Files with missing lines Patch % Lines
src/react/OptionalReduxProvider.jsx 71.42% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #768      +/-   ##
==========================================
- Coverage   83.36%   83.13%   -0.23%     
==========================================
  Files          40       40              
  Lines        1070     1091      +21     
  Branches      200      201       +1     
==========================================
+ Hits          892      907      +15     
- Misses        166      172       +6     
  Partials       12       12              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -48,7 +48,7 @@ describe('AppProvider', () => {
});
});

it('should render its children with a router', async () => {
it('should render its children with a router', () => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[inform] Needing to make these tests async was a clue that the previous approach with React.lazy was technically a breaking change for consuming MFEs' tests.

Also, note, I believe using React.lazy here would have prevented the component from being able to get rendered with SSR, as React.lazy depends on dynamic runtime imports. Using a dynamic import within a useEffect appears to be compatible with SSR.

@adamstankiewicz adamstankiewicz marked this pull request as draft February 21, 2025 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant